# $Id: PKGBUILD 183567 2013-04-23 14:33:21Z andyrtr $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Committer: Manolis Tzanidakis <manolis@archlinux.org>

pkgname=getmail
pkgver=4.40.1
pkgrel=1
pkgdesc="A POP3 mail retriever with reliable Maildir and command delivery."
arch=(any)
url="http://pyropus.ca/software/getmail"
license=("GPL")
depends=('python2')
source=(http://pyropus.ca/software/getmail/old-versions/$pkgname-$pkgver.tar.gz)
md5sums=('3a5a287de2ed75f5bc969108b78d5033')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  python2 setup.py build
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  python2 setup.py install --root=${pkgdir}
  # fix some broken shebang calls
  sed -i -e "s|#![ ]*/usr/bin/env python|#!/usr/bin/env python2|" $pkgdir/usr/lib/python2.7/site-packages/getmailcore/__init__.py
  sed -i -e "s|#![ ]*/usr/bin/env python2.3|#!/usr/bin/env python2|" $(find $pkgdir -name '*.py')
}
